<?php

namespace app\admin\validate;

use think\Validate;

class Role extends Validate
{
  protected $rule = [
    'rolename'=>'require|max:50',
    'nickname'=>'require|max:50'
  ];
  protected $message = [
    'rolename.require'=>'角色名不能为空!',
    'rolename.max'=>'角色名过长',
    'nickname.require'=>'昵称不能为空!',
    'nickname.max'=>'昵称过长!'
  ];
  protected $scene = [
    'add' =>['rolename', 'nickname'],
    'edit'=>['id','rolename', 'nickname'],
  ];
}
